package com.jianyun.jyzs.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.jianyun.jyzs.R;
import com.jianyun.jyzs.utils.RceLog;
import com.jianyun.jyzs.utils.UtilsStyle;
import com.jianyun.jyzs.widget.Anticlockwise;
import com.jianyun.jyzs.widget.voice.AudioRecorderButton;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by yangshijun on 2018/5/31.
 * 工程动态 录制音频界面
 */

public class EngineerRecordActivity extends AppCompatActivity {


    @BindView(R.id.iv_voice)
    AudioRecorderButton ivVoice;
    @BindView(R.id.mic_image)
    ImageView micImage;
    @BindView(R.id.chronometer)
    Anticlockwise chronometer;
    @BindView(R.id.recording_hint)
    TextView recordingHint;
    @BindView(R.id.recording_container)
    RelativeLayout recordingContainer;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        UtilsStyle.setStatusBarMode(this, true);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_record_aduio);
        ButterKnife.bind(this);
        initData();
    }




    private void initData() {
        ivVoice.setAudioFinishRecorderListener(new AudioRecorderButton.AudioFinishRecorderListener() {
            @Override
            public void onFinish(float seconds, String filePath) {
                RceLog.d("lml", filePath);
                Intent intent = new Intent();
                intent.putExtra("path", filePath);
                setResult(-1, intent);
                finish();
            }
        });
    }
}
